<div>{{ '<a href="javascript:alert(\'ok\')">Dangerous</a><span>Safe</span>'|sanitize_html }}</div>
<div>{{ '<img src="https://untrusted.com" />'|sanitize_html }}</div>
<div>{{ '<img src="https://trusted.com" />'|sanitize_html }}</div>
<div>{{ '<img src="https://trusted.com" />'|sanitize_html('basic') }}</div>
